#ifndef __IOT_CRC16_H__
#define __IOT_CRC16_H__

#include <stdio.h>
#include <string.h>
 
// 计算crc
unsigned short Cal_CRC16(unsigned char *pdata, int len);

// crc校验：modbus
unsigned short CRC16_Modbus(unsigned char *pdata, int len);

// 计算：单字节校验和，传入需要计算的字节，不包括校验位
unsigned char Cal_CheckSum(unsigned char *pdata, int len);

// 校验：单字节校验和，传入包括校验位在内的字节
int Check_CheckSum(unsigned char *pdata, int len);

#endif  //__IOT_CRC16_H__
